package com.liang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liang.mall.entity.Log;
import com.liang.mapper.LogMapper;
import com.liang.service.LogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统日志 服务实现类
 * </p>
 *
 * @author liang
 * @since 2021-05-10
 */
@Service
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements LogService {

    @Autowired
    LogMapper logMapper;

    @Override
    public IPage<Log> getList(Integer pageNum, Integer pageSize) {

        IPage<Log> logIPage = logMapper.selectPage(new Page<Log>(pageNum, pageSize), new QueryWrapper<Log>().orderByDesc("id"));

        return logIPage;
    }
}
